package LogIn;
import java.util.Scanner;
public class register {
    public static void main(String[] args) {
        Scanner S = new Scanner(System.in);
        String name = "dengweichao";
        String word = "123456789";
        int count = 5;
        while(count > 0) {
            count--;
            System.out.print("请输入用户名：");
            String username = S.next();
            System.out.print("请输入密码：");
            String password = S.next();
            if(name.equals(username) && word.equals(password)) {
                System.out.println("登录成功");
                return;
            }
            else{
                System.out.println("你还有"+count+"次机会");
                System.out.println("用户名或密码错误，请重新输入.");
                System.out.println();
            }
        }
        System.out.println("登录失败！！！");
    }
}
